package connections;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import serverManger.Server;

/**
 * confirm share box from another client 
 * @author ran,barak
 *
 */

public class AcceptSharedFolder extends HttpServlet{
	/**
	 * Default serialVersionUID
	 */
	private static final long serialVersionUID = 1L;

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		Server server = Server.getServerInst();
		// get the email address
		String email = req.getParameter("email");
		// confirm the share box
		server.acceptSharedFolder(email);
		resp.sendRedirect(resp.encodeRedirectURL("index.jsp"));
	}
}
